import java.util.ArrayList;
import java.util.List;

public class Test {
    public static List<Integer> removeDuplicates(int[] nums) {

        int count = 0;
        //List<Integer> ret = new ArrayList<>();
        boolean arr[] = new boolean[nums.length];
        for (int i = 0; i < nums.length; i++) {
            if(arr[nums[i]] == false) {
               nums[count] = nums[i];
               count++;
                arr[nums[i]] =true;
            }
        }

            return nums.length;
    }
    public static void main(String[] args) {
        int[] nums = {1,1,2};
        List<Integer> ret = removeDuplicates(nums);
        System.out.println(ret);
    }

   /* public static int  removeElement(int[] nums, int val) {
        int count = 0;
        int n = nums.length;
        for (int i = 0; i < n; i++) {
            if (nums[i] != val) {
                nums[count] = nums[i];
                count++;
            }
        }
        return count;
    }
    public static int removeDuplicates(int[] nums) {
        List<Integer> ret = new ArrayList<>();
        boolean arr[] = new boolean[nums.length];//fasle
        for (int i = 0; i < nums.length; i++) {


        }

        return ret.size();

    }

    public static void main(String[] args) {
        int[] nums = {0,0,1,1,1,2,2,3,3,4};
        int ret = removeDuplicates(nums);

    }
*/

 /*   public static void main(String[] args) {
        Card card  =new Card();
        System.out.println(card);
        //Card card = new Card();
        GameCard card1 = new GameCard();
        List<Card> ret = card1.BuyCard();
        System.out.println(ret);
        //


        System.out.println("洗牌");
        card1.shuffle(ret);
        System.out.println(ret);

        List<List<Card>> hand = card1.takeCard(ret);
        for (List<Card> ch: hand) {
            System.out.println(ch);
        }
     //   System.out.println(card1.takeCard(ret));

    }*/
   /* public static List<Character> game(String str1, String str2) {
        List<Character> ret = new ArrayList<>();
        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if(!str2.contains(ch+"")) {
                ret.add(ch);
            }
        }
        return  ret;
    }
    public static void main(String[] args) {
        String str1 = "welcome to cvtv";
        String str2 = "cvtv";
        List<Character> ret = game(str1,str2);
        //System.out.println(ret);
        for (char ch:ret) {
            System.out.print(ch+"");
        }

    }*/
}
